<template>
  <section>
    <el-form class="submit-form" ref="autoSignForm" :model="form" label-position="left" label-width="120px">
      <el-form-item label="签约手机号" prop="mobile">
        <el-input v-model="form.mobile" placeholder="需已开通IPS"></el-input>
      </el-form-item>
      <el-form-item label="签约天数" prop="validity">
        <el-input v-model="form.validity"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submit">签约提交</el-button>
        <el-button @click="reset('autoSignForm')">重置</el-button>
      </el-form-item>
    </el-form>
  </section>
</template>
<script>
  import {
    mapGetters,
    mapActions
  } from 'vuex'

  export default {
    computed: {
      ...mapGetters({
        form: 'autoSignBind_form'
      })
    },

    methods: {
      ...mapActions([
        'resetForm',
        'signBindSubmit'
      ]),
      submit() {
        this.signBindSubmit({
          vm: this
        });
      },
      reset(formName) {
        this.resetForm({
          vm: this,
          formName: formName
        });
      }
    }
  }
</script>

<style lang="scss">
  form {
    min-width: 400px;
  }
</style>